package com.example.mapper;

import com.example.entity.User;
import com.example.entity.example.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<User> selectByExampleWithLimit(@Param("example") UserExample example, @Param("begin") Integer begin, @Param("limit") Integer limit);

    User selectByTeacherId(@Param("id") String id);

    void bindTeacher(@Param("userId") Integer userId, @Param("teacherId") String teacherId);

    User selectByStudentId(String id);

    void bindStudent(@Param("userId") Integer userId, @Param("studentId") String studentId);

    String getStudentId(Integer id);

    String getTeacherId(Integer id);
}